home *** CD-ROM | disk | FTP | other *** search
- *******************************************************************
- * Die Macros CALL und CALLI *
- * *
- *******************************************************************
-
- CALL MACRO
- IFEQ NARG-2
- move.l \2Base,a6 ;kann an eigene Bedürfnisse
- ELSE ;angepaßt werden.
- move.l 4.w,a6
- ENDIF
- jsr _LVO\1(a6)
- ENDM
-
- CALLI MACRO
- jsr _LVO\1(a6)
- ENDM
-
-
- *******************************************************************
- * WaitEvent: Wartet auf Ereignisse am IDCMP und gibt CODE, *
- * CLASS, MouseX, MouseY und IAddress zurück. *
- * *
- *******************************************************************
- * Eingabe: a0 = UserPort *
- * *
- * Ausgabe: d0 = Code *
- * d1 = Class *
- * d3/d4 = MouseX/MouseY *
- * a1 = IAddress *
- *******************************************************************
-
- WaitEvent movem.l d2/d5-d7/a0/a2-a6,-(sp) ;Register retten
-
- move.l a0,a4 ;UPort nach a4
- move.b MP_SIGBIT(a0),d1 ;Sig. Nr. nach d1
- moveq #0,d0 ;d0 löschen
- bset d1,d0 ;BitNr. in d0 setzen
- CALL Wait ;und ab...
- move.l a4,a0 ;UPort nach a0
- CALLI GetMsg ;Msg holen
- move.l d0,d5 ;Msg retten
- beq.s .weg ;existiert Msg?
-
- move.l d0,a1 ;Msg nach a1 (für ARI)
- move.l im_Class(a1),-(sp) ;Klasse,
- move im_Code(a1),-(sp) ;Code,
- move im_MouseX(a1),-(sp) ;MausX,
- move im_MouseY(a1),-(sp) ;MausY,
- move.l im_IAddress(a1),-(sp) ;Adr in den Stapel
-
- .loop move.l a4,a0 ;UPort nach a0
- CALLI GetMsg ;Msg holen
- tst.l d0 ;existiert eine?
- beq.s .weiter ;nö -> Weiter geht es
-
- move.l d0,a1 ;Msg nach a1
- CALLI ReplyMsg ;Msg beantworten
- bra.s .loop ;--> zur Schleife
-
- .weiter move.l d5,a1 ;Msg nach a1
- CALLI ReplyMsg ;beantworten
-
- move.l (sp)+,a1 ;IAddress -> a1
- move (sp)+,d4 ;MouseY -> d4
- move (sp)+,d3 ;MouseX -> d3
- move (sp)+,d0 ;Code -> d0
- move.l (sp)+,d1 ;Class -> d1
-
- .weg movem.l (sp)+,d2/d5-d7/a0/a2-a6 ;Register in Urzustand
- rts ;...und weg!
-
-